﻿@{
    ViewBag.Title = "Home Page";
}

<form action='@Url.Action("UploadFile", "Home")' id="formContainer" method="post"  target="uploadIframe" enctype="multipart/form-data">
    <input type="file" name="fileUpload" id="fileUpload" />          
    <iframe id="uploadIframe" name="uploadIframe" src='@Url.Action("UploadFile", "Home")' width="0" height="0" scrolling="no" frameborder="0"></iframe>
</form>
<input type="submit" value="Upload File" id="buttonUploadFile" name="buttonUploadFile"/>

<p id="result"></p>

@section scripts {
<script type="text/javascript">
    $().ready(function () {
        $('#buttonUploadFile').click(function (event) {
            event.preventDefault();
            $('#result').text('Upload started.');
            $('#formContainer').submit(); //submit the file to the server
        });
    });
</script>
}
